<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<style>
  .top-bar {
    display: flex;
    background-color: black;
    align-items: center;
    width: 375px;
    height: 45px;
    overflow: hidden;
    transition: .5s ease-out;
  }
  .delete {
    width: 30px;
    display: flex;
    justify-content: center;
    cursor: pointer;
  }
  .delete img {
    width: 10px;
    height: 10px;
  }
  .logo {
    height: 30px;
    width: 30px;
    margin-left: 3px;
    margin-right: 30px;
  }
  span {
    flex: 1;
    font-size: 14px;
    color: white;
  }
  .btn {
    display: flex;
    align-items: center;
    width: 94px;
    height: 100%;
    color: white;
    background-color: red;
    justify-content: center;
  }
</style>
<body>
  <div class="top-bar">
    <div class="delete">
      <img src="/img/delete.png" alt="">
    </div>
    <img src="/img/logo.png" class="logo" alt="">
    <span>打开京东App,购物更轻松</span>
    <div class="btn">立即打开</div>
  </div>
  <script>
    var topbarEl = document.querySelector(".top-bar")
    var deleteEl = document.querySelector(".delete")
    deleteEl.onclick = function() {
      topbarEl.style.height = 0
    }
    topbarEl.ontransitionend = function() {
      console.log("asjdhfgasudf")
      topbarEl.remove()
    }
  </script>
</body>
</html>